package tgc.edu.tgq.demo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tgc.edu.tgq.demo.custom.BaseRepository;
import tgc.edu.tgq.demo.entity.Course;
import tgc.edu.tgq.demo.entity.Grade;

@Repository
public interface GradeRepository extends BaseRepository<Grade, Integer>{

	public List<Grade> findByStudentId(Integer id);

	public Grade findByStudentIdAndCourseId(Integer id, Integer kcId);
	
	@Query(value ="select distinct t.course from Grade t where t.student.tbClass.id=?1"  )
	public List<Course> findCourseByTbClassId(Integer bjId); 


}
